Introduction
This document explains how the digest converter Digester 2.1.1b operates.
This may help you in configuring the digester.par
file and explain how to control digester from the command line (UN*X users).
Digester goes through several stages to complete the conversion and read
all the user options.
Stage 1: Initialisation
First the parameters of digester are set to the default values (also explains
digester.par
):
The following parameters define the paths of several files:
SCRIPT "/vdham-bin/"
- This is the path to the post-send script (use with prepare mail button:
MAI 1
)
SITE "sites.asc"
- This is the name of the sites file (only when:
FIL 1)
PATH ""
- additional path for destination files (mac style use "
:folder:"
unix style use "folder/"
)
IMAGES ""
- additional path for the buttons
The following parameters use 2 arguments, issue and volume number at the
position of %d:
If you which to omit the value(s), use *%d
instead.
NAMA "IM%d-%d.html"
- file name prefix for 1 file (
TYP 1
)
NAMT "IMt%d-%d.html"
- file name prefix for toc file
(TYP 2
)
NAMP "IMp%d-%d.html"
- file name prefix messages file (
TYP 2 or 3
)
NAMM "IMm%d-%d.html"
- file name prefix programs file
(TYP 2 or 3
)
BOD "Info-Mac Digest "
- begin of digest phrase; always necessary! If not correct, digester
will not work.
VOL "Volume"
- volume prefix string, argument 2 of file name
- (optional: leave empty if not available, remember to modify file names!)
ISS "Issue"
- Issue prefix string, argument 1 of file name
- (optional: leave empty if not available, remember to modify file names!)
EOD "End of Info-Mac Digest"
- end of digest phrase, necessary, must be unique.
- BOT "Today's Topics:"
- begin of TOC, leave it empty if there's no delimiter in the original
digest.
EOT "----------------------------------------------------------------------"
- end of topics phrase, if empty, the
EOM
tag will be sought.
EOM "------------------------------"
- end of message phrase, is a unique delimiter between each message.
The following tags are only relevent if the file tag is on: (FIL 1)
RTD "/info-mac/"
- root directory of archive
BOF "[Archived as /info-mac/"
- begin of archived file path
EOF ";"
- end of file path marker
The following tags are only for Macintosh systems (default is Netscape):
FTYPE "TEXT"
- destination file type
FCREAT "MOSS"
- destination file creator
The following are switches (if you want to control these by command line,
remember to delete them here!):
TYP 1
- default is make 1 file only
- BUT 1
- switch the fancy buttons on
MAI 1
- do the mail button, don't forget to set the script path (
SCRIPT
)
FIL 1
- check for archive files and link 'em, you need to specify
SITE,
RTD, BOF
and EOF
tags
URL 1
- check for URLs and link them, looks for
mailto:, ftp:, gopher:
or http:
MURL 0
- Do mail URLs, so there is a direct link from the digest, when quoted
will copy entire digest!!
ADON 1
- Switch on the special advertising thing at the top of the issue.
ADON 1
- Switch on the special advertising thing at the top of the issue.
ADLINK "ad.html"
- This is the document linked to the ad when selected.
ADIMAGE "ad.gif"
- This is the image displayed.
MFROM "From: "
- Mail from selection string.
MTO "To: "
- Mail to selection string.
MDATE "Date: "
- Mail date selection string.
MSUBJECT "Subject: "
- Mail subject selection string.
DEBUG 0
- Show debug info: set this to 1 if you want more feedback on what digester
is doing.
PROMPT 0
- don't prompt me for options, will not ask for type, mail script link
or fancy buttons options.
- if you want to set these by hand every time digester starts, set this
to 1
Stage 2: Reading the command line arguments (UNIX version only)
The following message is displayed at start-up:
You can also start digester from the command line.
digester <filename> <b> <2> <3> <p> <f=digest.par>
b: use fancy buttons and icons.
2: split up file in 2 parts
3: split up file in 3 parts
p: enable post reply.
f=: alternative parameters file.
Well, need I say more? Okay just an example. I have the following shell
command called doit
#!/bin/sh
digester %1 b p f=digester.par
digester %1 3 p f=digester.par
Each time I receive a new digest I use this shell command as follows:
doit infomac.txt
This will give me 4 files: 1 entire digest, 1 toc file, 1 messages file
and 1 programs file.
Remember to delete the button and type switches in the digester.par file!
Stage 3: Get the parameters and options
This will read the parameters from the parameter file (default: digester.par
).
This will overwrite any parameters set during initialisation and those given
as arguments on the command line.
If there is no parameter file or the PROMPT
switch is 1 the
fancy buttons, prepare mail and output type are asked (after stage 5).
Stage 4: Get the archive mirror sites file
Digester first reads the number of mirror sites.
Then the C-format strings are read. The path to the file starting with /info-mac/
is inserted at the position of the %s
.
WARNING: there is a small bug in digester that I am looking for. Please
add 1 to the number of sites at the beginning of the sites.asc
file and add some blank lines at the end. Digester is forgetting to read
the last line.
Stage 5: Get the source file name
The file to be converted should be in the same folder as the digester program
(sorry folks, but I'll work on that). UNIX users can give the entire path.
Stage 6: Create the output files
Either 1, 2 or 3 output files are opened depending on the TYP
parameter or the options set, and the FIL
parameter.
In order to determine the name of the output file(s), the BOD
parameter is used to find the title of the digest. On the same line the
ISS
ue and VOL
ume are sought, if they have been
specified (if these parameters are empty, the destination file name will
be asked).
If only the ISS
ue parameter has been set, only 1 parameter
will be used to specify the name. In this case only 1 %d
should
be placed in the file name parameters.
If digester cannot find the BOD
it will simply stop with an
error message.
Stage 7: Make the table of topics: PASS 1
First the usual table of topics is skipped. Digester first looks for the
BOT
if specified, then looks for EOT
if specified
(otherwise EOM
).
Now each message is checked for subject and if it has an archive file associated
with it (if the FIL
switch is on).
The subjects are linked to the messages either in the same or in the separate
program and messages file.
If the output is 2 files, the table of contents is written to the appropriate
files. At the end both files are linked to each other.
Digester closes the input file.
Now the FTP link is placed if the FIL
switch is on.
Stage 8: Write the messages: PASS 2
Digester opens the input file again and reads past the title BOD
.
If a BOT
and EOT
are set properly digester expects
1 empty line after BOT
and the topics list and 1 empty line
after the list. After skipping the list, all the subsequent lines are filtered
and URL linked (if URL 1
) and written after the table of contents
(in case of the info-mac digest, the moderators' directions for submitting
messages or files is place). This is done until the EOT
or
EOM
tag is found.
Now, before each message a tag and a navigation panel is placed.
The From, Subject, To
and Date
lines are identified,
linked (if MURL
is on) and written to the file.
Now the message is written to the file in mono-spaced
font
and (if URL
is on) included URLs are linked. This is done to
keep the output format predictable which is necessary to represent tables
or program code included in messages.
Digester continues to link messages, until the EOD
tag is found
or the end of the file is reached.
Stage 9: Finish up
After linking all messages, a last navigation panel is placed and the trailer
is written.
After closing the output files, the type and creator info is changed according
to the FTYPE
and FCREAT
parameters (of course
not for the unix system).
Well, that's all folks. I can imagine that you still may have questions
about digester. If you need help, please do not hesitate to mail me at:
a.c.vanderham@et.tudelft.nl.